package com.frx.leetoffer;

/**
 * Created with IDEA
 *
 * @author: xrf
 * @Date: 2019/11/4
 * @Time: 16:26
 */
public class ClimbStairs {
    public static void main(String[] args){
        System.out.println(climb(10));
    }

    public static int climb(int n){
        int a = 1;
        int b = 2;
        int temp = 0;
        for (int i=3;i<=n;i++){
            temp = a + b;
            a = b;
            b = temp;
        }

        return temp;
    }

}
